<html>
<head><meta charset="utf-8"><title>-Zvalidate-mir errors on master · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html">-Zvalidate-mir errors on master</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200032511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200032511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200032511">(Jun 07 2020 at 17:00)</a>:</h4>
<p>Running the test suite with <code>-Zvalidate-mir</code> enabled I'm getting a lot of errors about incorrect callee types:</p>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: broken MIR in DefId(1:2106 ~ core[66db]::ops[0]::function[0]::FnMut[0]::call_mut[0]) (input to phase Const) at bb0[0]:
encountered non-callable type Self in `Call` terminator
   --&gt; /home/jonas/dev/rust/src/libcore/ops/function.rs:154:5
    |
154 |     extern &quot;rust-call&quot; fn call_mut(&amp;mut self, args: Args) -&gt; Self::Output;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</code></pre></div>


<p>Presumably it needs to accept <code>Self</code> as well there?</p>
<p>cc <span class="user-mention" data-user-id="120791">@RalfJ</span></p>



<a name="200032974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200032974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200032974">(Jun 07 2020 at 17:11)</a>:</h4>
<p>I have a fix that I'll roll into my next PR for the validator</p>



<a name="200032981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200032981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200032981">(Jun 07 2020 at 17:11)</a>:</h4>
<p>Sounds to me like it has to normalzie more</p>



<a name="200032985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200032985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200032985">(Jun 07 2020 at 17:11)</a>:</h4>
<p><code>Self</code> is not something you can actually call (Miri would ICE on such MIR)</p>



<a name="200033156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200033156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200033156">(Jun 07 2020 at 17:15)</a>:</h4>
<p>is it not generic?</p>



<a name="200033219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200033219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200033219">(Jun 07 2020 at 17:16)</a>:</h4>
<p>I mean validation happens on generic MIR at least, and I'm not sure there's a subst for <code>Self</code> there</p>



<a name="200033223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200033223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200033223">(Jun 07 2020 at 17:16)</a>:</h4>
<p>(I'm not actually sure what function this is, probably an <code>FnOnce</code> shim)</p>



<a name="200033437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200033437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200033437">(Jun 07 2020 at 17:22)</a>:</h4>
<p><code>build_call_shim</code> should probably substitute the actual type for <code>Self</code>, it has it available.</p>



<a name="200033455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200033455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200033455">(Jun 07 2020 at 17:22)</a>:</h4>
<p>Ah, okay</p>



<a name="200066576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir%20errors%20on%20master/near/200066576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/-Zvalidate-mir.20errors.20on.20master.html#200066576">(Jun 08 2020 at 07:49)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/73109">https://github.com/rust-lang/rust/issues/73109</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>